﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CreateLookupColumnInfo.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the CreateLookupColumnInfo type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Wss.Entities
{
    using System;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [CollaborisClass(
       Title = "Create Lookup Column Info",
       ReleaseStatus = ReleaseStatus.Stable,
       DisableDocumentation = false,
       ContactAuthorEmail = "Support@Collaboris.co.uk",
       Summary = "Defines the parameters to create a new site lookup column."
    )]
    [Serializable]
    public class CreateLookupColumnInfo : WSSEntityBase
    {
        #region Constants and Fields

        private bool allowMultipleValues;

        private string fieldName;

        private string group;

        private string lookupFieldName;

        private string lookupListUrl;

        private bool required;

        #endregion

        #region Properties

        [CollaborisProperty(
             Summary = "Specifies whether to allow multiple values in the lookup column.",
             Title = "Allow Multiple Values",
             Example = @"true",
             Required = false,
             InputHint = InputHint.Boolean
        )]
        public bool AllowMultipleValues
        {
            get
            {
                return this.allowMultipleValues;
            }
            set
            {
                this.allowMultipleValues = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies the field name for the new lookup column.",
             Title = "Field Name",
             Example = @"PagesTitle",
             Required = true,
             InputHint = InputHint.SingleText
        )]
        public string FieldName
        {
            get
            {
                return this.fieldName;
            }
            set
            {
                this.fieldName = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies the group name to add the new lookup column to.",
             Title = "Group",
             Example = @"SAF Columns",
             Required = false,
             InputHint = InputHint.SingleText
        )]
        public string Group
        {
            get
            {
                return this.group;
            }
            set
            {
                this.group = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies the field name to find within the list.",
             Title = "Lookup Field Name",
             Example = @"Title",
             Required = true,
             InputHint = InputHint.SingleText
        )]
        public string LookupFieldName
        {
            get
            {
                return this.lookupFieldName;
            }
            set
            {
                this.lookupFieldName = value;
            }
        }


        [CollaborisProperty(
             Summary = "Specifies the URL for the list which contains the field to lookup.",
             Title = "Lookup List Url",
             Example = @"${CurrentWeb.Url}/Pages",
             Required = true,
             InputHint = InputHint.Url
        )]
        public string LookupListUrl
        {
            get
            {
                return this.lookupListUrl;
            }
            set
            {
                this.lookupListUrl = value;
            }
        }

        [CollaborisProperty(
          Summary = "Specifies whether to make the new lookup column a required field.",
          Title = "Required",
          Example = @"false",
          Required = true,
          InputHint = InputHint.Boolean
        )]
        public bool Required
        {
            get
            {
                return this.required;
            }
            set
            {
                this.required = value;
            }
        }

        #endregion
    }
}